package customer.design.dispatcher.dispatchermode.real.controller;

import customer.design.dispatcher.dispatchermode.bean.MsgContent;
import customer.design.dispatcher.dispatchermode.real.aware.MyContextUtil;
import customer.design.dispatcher.dispatchermode.real.biz.AbstractBiz;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ldanniel
 */
@RestController
@RequestMapping
public class StrategyController {

    @PostMapping("/strategy")
    public ResponseEntity<String> strategy(){
        //String s = MsgConfig.container.get(msgContent.getProcessType()).handleMsg(msgContent.getContent());
        AbstractBiz<Object> abstractBiz = MyContextUtil.getBeanName("SYS_MSG", "002");
        Map<String,Object> paramMap = new HashMap<>();
        paramMap.put("id",100);
        paramMap.put("name","测试分发模式");
        Object result = abstractBiz.execute(paramMap);
        return ResponseEntity.ok(result.toString());
    }
}